
package cz.czu.pef.DataModelling.domainObjects;

import java.util.*;

public class MedicalExaminationTypeForRoleType extends IdObjectImpl implements IdObject
{
  private static final long serialVersionUID = 7470720138832999106L;

  /*
	 * Entity attributes
	 */
	private MedicalExaminationType medicalExaminationType;

	/*
	 * Relations
	 */
	private Set<RoleType> roleTypes;

	private long periodicityInSeconds;

	public MedicalExaminationTypeForRoleType()
	{
		super();
	}

	public MedicalExaminationTypeForRoleType(MedicalExaminationType medicalExaminationType, long periodicityInSeconds)
	{
		super();
		this.medicalExaminationType = medicalExaminationType;
		this.periodicityInSeconds = periodicityInSeconds;
	}

	public Set<RoleType> getRoleTypes()
	{
		return roleTypes;
	}

	public List<RoleType> getRoleTypesAsList()
	{
		return new ArrayList<RoleType>(getRoleTypes());
	}

	public void addRoleType(RoleType roleType)
	{
		if (this.roleTypes == null)
			this.roleTypes = new HashSet<RoleType>();
		this.roleTypes.add(roleType);
	}
	
	public long getPeriodicityInSeconds()
	{
		return periodicityInSeconds;
	}

	public void setPeriodicityInSeconds(long periodicityInSeconds)
	{
		this.periodicityInSeconds = periodicityInSeconds;
	}

	
  public void setMedicalExaminationType(MedicalExaminationType medicalExaminationType)
  {
    this.medicalExaminationType = medicalExaminationType;
  }

  
  public void setRoleTypes(Set<RoleType> roleTypes)
  {
    this.roleTypes = roleTypes;
  }

  public String toString()
	{
		StringBuilder builder = new StringBuilder();
		builder.append("MedicalExaminationTypeForRoleType [roleTypes=");
		builder.append(roleTypes);
		builder.append(", periodicityInSeconds=");
		builder.append(periodicityInSeconds);
		builder.append(", toString()=");
		builder.append(super.toString());
		builder.append("]");
		return builder.toString();
	}

	public MedicalExaminationType getMedicalExaminationType()
	{
		return medicalExaminationType;
	}
}